UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0U1ZfmM4Ig2y2LpckMZYkqmX95AztDqSbhv8uvdLWBI=' 
WHERE 
  key_id = '00eca39870d3134dd65d75e3d4bb12ac3d3cc1508521cf62b67eca7d7cca4891' 
  AND (
    token = '0U1ZfmM4Ig2y2LpckMZYkqmX95AztDqSbhv8uvdLWBI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030