UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EeL11MB7q6yXvjn+3u+BMRbqgWk8yFICP33P3A2Ok0g='
WHERE
key_id = '199ef9317759ffd5458337d0ce663efb5a81a4786c8416b1752f85f5922d6ea1'
AND (
token = 'EeL11MB7q6yXvjn+3u+BMRbqgWk8yFICP33P3A2Ok0g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)