UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9W63pB/xrl0Vbz1eL0TmxwMAM+tzQ4ZyDnWcLhg2gW8='
WHERE
key_id = '37883ec361fd8332463f1bcfb337abfe104486d3f365d23b0cd3392d349ca148'
AND (
token = '9W63pB/xrl0Vbz1eL0TmxwMAM+tzQ4ZyDnWcLhg2gW8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)