UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1Mbl3gjPmPVhTgw823y0vCVDOtbIexpeasbacldYCmE='
WHERE
key_id = 'cf9e6aaa32f3d0bfc0f8c72ff9b0030483abaeff699adae342c6a2dc69694aff'
AND (
token = '1Mbl3gjPmPVhTgw823y0vCVDOtbIexpeasbacldYCmE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)