UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VxNZ/+aMM47whmaRUFYl7VHRok0Y5IjDqO4oFuFwV7M='
WHERE
key_id = 'ea52fc0a16dae9c41f6d38f88664f81379a7f14a1ebb44259b49882b081882fb'
AND (
token = 'VxNZ/+aMM47whmaRUFYl7VHRok0Y5IjDqO4oFuFwV7M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)