UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BpTNYbTtTQQFLdojBHCVek5wwXubmgDtojNZCDeWYR0='
WHERE
key_id = '70c1764ae8d1ec1aa93fb21e05602d657976e8c2f4e496ab6c958c3ca07a7c26'
AND (
token = 'BpTNYbTtTQQFLdojBHCVek5wwXubmgDtojNZCDeWYR0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)