UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Fh2s4zh56hJwZ0T2d5R9LZvGWcCJQ+80jDSih10uecA='
WHERE
key_id = '347d06fad3a1e7871b5aba779f94e0aacbc9afa040092d1c2a7b757446262615'
AND (
token = 'Fh2s4zh56hJwZ0T2d5R9LZvGWcCJQ+80jDSih10uecA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)