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

Query time 0.00032