UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j/MBVlZOwHI8z964qWzr2SURCJTB3rPeZIhtJWE9IWc=' 
WHERE 
  key_id = 'a9b7b8332fe81a1cab6c6e1d371c40a4f1c3366a1e3b0dddfe086bc24bf7b53e' 
  AND (
    token = 'j/MBVlZOwHI8z964qWzr2SURCJTB3rPeZIhtJWE9IWc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019