UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IqoOEV78IxfVN0kat45J9gMGuEzLDLxnfnBvplNCWmY='
WHERE
key_id = '300b3e594f087ead686f4b9b31eae09402ac5efe274cd5ca97500da5610f5e73'
AND (
token = 'IqoOEV78IxfVN0kat45J9gMGuEzLDLxnfnBvplNCWmY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)