UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9ECXJGOUrnuccmGqP9ccoapA1XwbEi4Qrl1hRuIthhU=' 
WHERE 
  key_id = '7fdb81103fb4427bd73e3ffc8b872b43203cf5d41bb46f8350c8c0ff80165295' 
  AND (
    token = '9ECXJGOUrnuccmGqP9ccoapA1XwbEi4Qrl1hRuIthhU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030