UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pqvmIt0JjMOavPSO3ZqnxmQu2gem/yTzQ6XdnvLIwa4='
WHERE
key_id = '02f0a1cf7232a735fd685b9cb58caa568d4275841433100113c094860c6ce2cb'
AND (
token = 'pqvmIt0JjMOavPSO3ZqnxmQu2gem/yTzQ6XdnvLIwa4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)