UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7K7vl85bbZNQRNTvGHn+JzNpSGRashgHrCejTlXyEoc='
WHERE
key_id = '84ebb2b1073580bd56c347d737b5f6d5fe201861361356b017d0a2a67709e31d'
AND (
token = '7K7vl85bbZNQRNTvGHn+JzNpSGRashgHrCejTlXyEoc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)