UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nE4El+MRHOJJuR9dq2oM6MZHMsGiApKSP3kUsEvS3Lk='
WHERE
key_id = '04557a0ebaf25fb3a6335dc48ba4e7e17fbb253500095d7dbe9b0ffa7f213501'
AND (
token = 'nE4El+MRHOJJuR9dq2oM6MZHMsGiApKSP3kUsEvS3Lk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)