UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'haDWnsry8Brsmxcv1pKEdV4QDEb6i3ugA/47hyVQk1c=' 
WHERE 
  key_id = '56c3d4d13be89aa858b9b2dcec4ca6a9730a159f2fceb1449d1a3c0beec858fd' 
  AND (
    token = 'haDWnsry8Brsmxcv1pKEdV4QDEb6i3ugA/47hyVQk1c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033