UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MjipVJA21Vhliepfq/7FL+LLmY2DCxr9UHRSg9ZhC+w=' 
WHERE 
  key_id = 'c433c8fcc41b1e67dcc7e01d39b2eff9ce0c839fccaf01cebe77801896cc1a03' 
  AND (
    token = 'MjipVJA21Vhliepfq/7FL+LLmY2DCxr9UHRSg9ZhC+w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00062