UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zDq+9kEtpuqpqjAJBBP5katAegfZbAjNjCK8qaRGbgc='
WHERE
key_id = '9dfde8eac5d057a3d2f093c0a7025c2185fdce19771fe8b77cee287dd717d66d'
AND (
token = 'zDq+9kEtpuqpqjAJBBP5katAegfZbAjNjCK8qaRGbgc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)