UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iLBp02liQxD7//aia9/LmJalCOpqqlzRfbc8FICEWg4='
WHERE
key_id = '98f7e0482761cd266354470b6062a60db1dc560aca1dd30cae0952355a77da84'
AND (
token = 'iLBp02liQxD7//aia9/LmJalCOpqqlzRfbc8FICEWg4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)