UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SAMRQoqupBH8EoeoJg30ytzLAR06t6IOCWLFKc+j2Xs='
WHERE
key_id = 'cb9eca07f849d0e115c5615d732af7bae926111dec34752f4669b717e121b2f2'
AND (
token = 'SAMRQoqupBH8EoeoJg30ytzLAR06t6IOCWLFKc+j2Xs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)