UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wYwzyJ9NJjsMGBspsfpMh2qiYuivOCSNXjGHVINjeOQ='
WHERE
key_id = '69b8860f7925e4bd0ae04a0487d970a70e34d94e8e83e61bfd1717a7601ace7d'
AND (
token = 'wYwzyJ9NJjsMGBspsfpMh2qiYuivOCSNXjGHVINjeOQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)