UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x+WmuORDWFl2jufyOjb2/16potfu7ZebL8rt5YRKn/o=' 
WHERE 
  key_id = '856186cc128cf18778792a64a90c567778dad10a38264f2282e7e05cd27b359b' 
  AND (
    token = 'x+WmuORDWFl2jufyOjb2/16potfu7ZebL8rt5YRKn/o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048