UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6OXdyE/oSZtOT/KueemuW/w/OFPb0gDH1KVqvCMqvbI='
WHERE
key_id = 'd8a4554b3e616787aaeb7a8434a5d8cbfa1980fb6eae4eee4b8a31ee39b8c268'
AND (
token = '6OXdyE/oSZtOT/KueemuW/w/OFPb0gDH1KVqvCMqvbI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)