UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VmkSfpO2X4HTdKnNEJgS3k8aQHiTyHZkLUP9eXXdOLY='
WHERE
key_id = 'e90b52163826a680857a30c44dd54eb58bdba54ca2c38125e7734ef07e2ea906'
AND (
token = 'VmkSfpO2X4HTdKnNEJgS3k8aQHiTyHZkLUP9eXXdOLY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)