UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UevUgNfc4VzaaGBbvE/DbQEQ5wek9Fmw8JUPaycFUBI='
WHERE
key_id = 'a022f6d2650a696c36462a320ee41f6bfb1cae69b2369f993b011f1ad60aa373'
AND (
token = 'UevUgNfc4VzaaGBbvE/DbQEQ5wek9Fmw8JUPaycFUBI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)