UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M+WiCP3KayO/SWQUTm9cg82jIyZ8xqZAED75RnQpnfM='
WHERE
key_id = '60a32b357cd35ca6d88e9bb0a4af197cb3a821a7ef240c83402b0d517f0a7ea5'
AND (
token = 'M+WiCP3KayO/SWQUTm9cg82jIyZ8xqZAED75RnQpnfM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)