UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qmt6/VDfvJ0hmCWpucGSHxW54G5acJc4eLM7CQ3hnXg='
WHERE
key_id = 'a209f63722b089917a9ee854dfbe0937dec221cb3fa518a293febc22ad044cf2'
AND (
token = 'qmt6/VDfvJ0hmCWpucGSHxW54G5acJc4eLM7CQ3hnXg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)