UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'poWr5xsogoJhJ5+8USIhbATjSPxhTvqxiJtmqMeyZlA='
WHERE
key_id = '38f428642cbca08b878bbacd2f79bf5a3388f1d69dbed1182ad9de7f1a88a108'
AND (
token = 'poWr5xsogoJhJ5+8USIhbATjSPxhTvqxiJtmqMeyZlA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)