UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ugGKtVswbN+JOtWSUThPkjitFHrmH8gVp/YtiM2hC+E='
WHERE
key_id = '105133f0137d3cab3a39e4d34f6056477e300ac5bc2347f90b256f68820cc6ab'
AND (
token = 'ugGKtVswbN+JOtWSUThPkjitFHrmH8gVp/YtiM2hC+E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)