UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qkYuCjyoTXmKwfD13Xlv8fwfCcCNnwNQXr4Jv7N1tC0='
WHERE
key_id = '3a72f635e8dac72fd20929d528b425d3b1ab20601fcc6130bfb9432fd1d0e749'
AND (
token = 'qkYuCjyoTXmKwfD13Xlv8fwfCcCNnwNQXr4Jv7N1tC0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)