UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5K87T16H9Os/1bbYzHj7aDMHFt2vnGFBD2QeVvAQpmk=' 
WHERE 
  key_id = '4ac4beb866966bead34a260acf433d48dcc557b155fdddb8a2d038b1519abb62' 
  AND (
    token = '5K87T16H9Os/1bbYzHj7aDMHFt2vnGFBD2QeVvAQpmk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048