UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iQspjrrhxKzTJGVxioyOe6XLaGQyhbUKLjdjg/8RN7I='
WHERE
key_id = '47e20cbeb01b98ed0412903b99baff5881cb85ec61efa4a4f64a121a44f2e769'
AND (
token = 'iQspjrrhxKzTJGVxioyOe6XLaGQyhbUKLjdjg/8RN7I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)