UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VO45jqBBa9wXjGClKA5LXR/eAteBSxfkRZS9plo0zAU='
WHERE
key_id = '488ee28d41df422734b9493a43da9678b285f37ed0f7acea0e87414e9332ee7e'
AND (
token = 'VO45jqBBa9wXjGClKA5LXR/eAteBSxfkRZS9plo0zAU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)