UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Dl0BsDtsVeNM9nZrMz2kW4MwQ2zEztc0SSga1IWy0K8=' 
WHERE 
  key_id = 'd0763434ac3a30151c95df9f319c3a4bf5649ad22cb0f170e7d4eaf601d2e401' 
  AND (
    token = 'Dl0BsDtsVeNM9nZrMz2kW4MwQ2zEztc0SSga1IWy0K8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041