UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CKsrkxhm+e/MqSWTK2851FeHrsn2oVPiTRt0ASRm5Fc='
WHERE
key_id = 'f2210a0d28eef08635708c03cc4a127a951782dd2e5ccad982d3c44b1e3a3a5f'
AND (
token = 'CKsrkxhm+e/MqSWTK2851FeHrsn2oVPiTRt0ASRm5Fc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)